package com.atguigu.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * spu信息
 * 
 * @author GuanMing.Zhu
 * @email xiaoming.080797@gmail.com
 * @date 2020-10-20 20:52:22
 */
@Data
@TableName("pms_spu_info")
@NoArgsConstructor
@AllArgsConstructor
public class SpuInfoEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 商品id
	 */
	@TableId
	private Long id;
	/**
	 * 商品名称
	 */
	private String spuName;
	/**
	 * 商品描述
	 */
	private String spuDescription;
	/**
	 * 所属分类id
	 */
	private Long catalogId;
	/**
	 * 品牌id
	 */
	private Long brandId;
	/**
	 * 
	 */
	private BigDecimal weight;
	/**
	 * 上架状态[0 - 创建，1 - 上架，2 - 下架]
	 */
	private Integer publishStatus;
	/**
	 * 
	 */
	private Date createTime;
	/**
	 * 
	 */
	private Date updateTime;

	/**
	 * 品牌名
	 */
	@TableField(exist = false)
	private String brandName;

	public SpuInfoEntity(Integer publishStatus) {
		this.publishStatus = publishStatus;
		this.updateTime = new Date();
	}

    public void initDate() {
		this.createTime = new Date();
		this.updateTime = new Date();
	}
}
